package com.xsz.oa.model.entity.sys;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

/**
 * 
 * @author xsz
 * @date 2015.12.27
 *
 */
public class Role {
	private Integer id;
	private String name;
	private String resourceIds;
	private String description;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getResourceIds() {
		return resourceIds;
	}

	public void setResourceIds(String resourceIds) {
		this.resourceIds = resourceIds;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List<Integer> getResourceIdList() {
		String[] resourceIdArr = this.resourceIds.split(",");
		List<Integer> list = new ArrayList<Integer>();
		for (String resourceId : resourceIdArr) {
			if (StringUtils.isEmpty(resourceId))
				continue;
			list.add(Integer.valueOf(resourceId));
		}
		return list;
	}

}
